﻿<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<th:block th:include="include :: header('公司动态列表')" />
	<link th:href="@{/company/css/publice.css}" rel="stylesheet" />
	<link th:href="@{/company/css/style.css}" rel="stylesheet" />
	<script type="text/javascript" th:src="@{/company/js/jquery1.42.min.js}" ></script>
	<script type="text/javascript" th:src="@{/company/js/jquery.SuperSlide.2.1.1.js}" ></script>
	<script type="text/javascript" th:src="@{company/js/style.js}" ></script>
</head>
<style>
	.bg-white {
		background-color: white !important;

	}

	#bootstrap-table {
		/*margin-top: 10px;*/
		border-left: 0px;
		border-right:0px;
		border-top:0px;
		border-bottom: 0px;
	}
	#bootstrap-table th{
		border-left: 0px;
		border-right: 0px;
		border-top:0px;
		border-bottom: 0px;
	}
	#bootstrap-table td{
		padding-top:40px;
		border-left: 0px;
		border-right: 0px;
		border-top:0px;
		border-bottom: 0px;
	}
	.content_studys a h3{
		font-size: 13px;
		color: #333333;
		font-weight: normal;
		margin-bottom: 5px;
	}
	.content_studys h3{
		font-size: 13px;
		margin-bottom: 5px;
	}
	.content_studys a:hover h3{
		color:#0F95F3;
	}
	.content_studys p{
		font-size: 12px;
		color: #9B9B9B;
		line-height: 23px;
		text-align: justify;
	}
</style>
<body>
<!--top_bar-->
<div class="clear"></div>
<div class="topWrap">
	<div class="top_bar">
		<div class="top_left">
			欢迎访问丰收机械制造官方网站！
		</div>
		<div class="top_right">
			<p class="icon icon1">138-9361-5566</p>
			<p class="icon icon2">官方微信</p>
			<p class="icon icon3">企业微博</p>
		</div>
	</div>
</div>
<!--nav-->
<div class="clear"></div>
<div class="navWrap">
	<div class="logo"><a href="#"><img th:src="@{/company/img/logo.png}"></a></div>
	<div class="nav_bar">
		<a th:href="@{/enterprise/index}">首页</a>
		<a th:href="@{/enterprise/brief}">公司简介</a>
		<a th:href="@{/enterprise/dynamic}" class="cur">公司动态</a>
		<a th:href="@{/enterprise/notice}">公告管理</a>
		<a th:href="@{/enterprise/datainfo}" >数据信息</a>
		<a th:href="@{/enterprise/studyYard}">学习培训</a>
	</div>
</div>
<!--banner-->
<div class="clear"></div>
<div class="trends_banner" style="text-align:center">
	<a href="#">
	<img th:src="@{/company/temp/trends_banner.jpg}">
	</a>
</div>
<!--content-->
<div class="clear"></div>
<div class="contentWrap">
	<div class="content_slide">
		<div class="slide_top">
			<h2>MESSAGE</h2>
			<p>公司动态</p>
		</div>
		<div class="slide_bot">
			<ul>
				<li>
					<a href="#">
						<img th:src="@{/company/img/slide_wx.png}"/>
						<p>官方微信</p>
					</a>
				</li>
				<li>
					<a href="#">
						<img th:src="@{/company/img/slide_wb.png}"/>
						<p>企业微博</p>
					</a>
				</li>
			</ul>
			<strong>机械制造有限责任公司</strong>
			<img th:src="@{/company/img/slide_ewm.png}" class="img"/>
		</div>
	</div>
	<div class="content_trends">
		<h2><a th:href="@{/enterprise/index}">首页</a><i>></i><a th:href="@{/enterprise/dynamic}">公司动态</a></h2>
			<table id="bootstrap-table"></table>
	</div>

</div>

<!--foot-->
<div class="clear"></div>
<div class="footWrap">
	<div class="footer">
		<div class="foot_l">
			<p><img th:src="@{/company/img/foot_icon1.png}">138-9361-5566</p>
		</div>
		<div class="foot_r">
			<p class="wz">©2020 机械制造有限责任公司版权所有，并保留所有权利</p>
		</div>
	</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
	var prefix = ctx + "enterprise";

	$(function() {
		var options = {
			url: prefix + "/dynamicList",
			showToggle: false, // 是否显示详细视图和列表视图的切换按钮
			showRefresh: false,// 是否显示刷新按钮
			showSearch: false,// 是否显示检索信息
			showColumns: false,// 是否显示隐藏某列下拉框
			showHeader: false, // 是否显示表头
			pageSize:5, // 每页的记录行数（*）
			sortName: "releaseTime", // 排序列名称
			sortOrder: "desc",  // 排序方式  asc 或者 desc
			classes: "table table-bordered table-striped table-sm table-dark",
			onClickRow: function(row,$element,field){
				window.open(prefix + '/dynamicDetail/'+row.dynamicId);
			},
			rowStyle: function(row, index) {
				var classes = [
					'bg-white'
				]
					return {
						classes: classes
					}
			},
			columns: [
				{
					field: 'dynamicId',
					title: '动态Id',
					visible: false
				},
				{
                    formatter: function(value, row, index) {
						var actions = [];
						var releaseTime = row.releaseTime.substring(0,10);
						var dynamicContent = row.dynamicContent.substring(0,500)+'......';
						actions.push('<a class="content_studys"><h3>'+row.dynamicTitle+'&nbsp&nbsp&nbsp&nbsp'+releaseTime+'</h3><p>'+dynamicContent+'</p></a> ');
						return actions.join('');
						//onclick="dynamicDetail(\'' + row.dynamicId + '\')"
					}
                }]
		};
		$.table.init(options);
	});
	
	function dynamicDetail(dynamicId){
		alert(dynamicId);
		var formData = new FormData();
		formData.append("dynamicId",dynamicId);
		$.ajax({
            url: prefix + "/dynamicDetail",
            type: 'post',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
            dataType: "json",
            success: function(data){
            	alert(data);
            }
        });
        formData = new FormData();
	}
</script>
</body>
</html>

